home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 4.9 KB | 155 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWDscOpr.cpp
- // Release Version: $ ODF 1 $
- //
- // Copyright: © 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWDSCOPR_H
- #include "FWDscOpr.h"
- #endif
-
- #ifndef FWDESC_H
- #include "FWDesc.h"
- #endif
-
- #ifndef FWSCPTBL_H
- #include "FWScptbl.h"
- #endif
-
- //========================================================================================
- // Runtime Information
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment fwsemevt2
- #endif
-
- //---------------------------------------------------------------------------------------
- // operator FW_CDesc& << FW_CDesc&
- //---------------------------------------------------------------------------------------
-
- FW_CDesc& operator<< (FW_CDesc& desc, const FW_CDesc& other)
- {
- desc.PutDataByDesc(other);
- return desc;
- }
-
- //---------------------------------------------------------------------------------------
- // operator FW_CDesc& >> FW_CDesc&
- //---------------------------------------------------------------------------------------
-
- const FW_CDesc& operator>> (const FW_CDesc& desc, FW_CDesc& other)
- {
- other = desc;
- return desc;
- }
-
- //---------------------------------------------------------------------------------------
- // operator FW_CDesc& << ODDescType&
- //---------------------------------------------------------------------------------------
-
- FW_CDesc& operator<< (FW_CDesc& desc, ODDescType typeValue)
- {
- desc.PutDataByPtr(typeType, &typeValue, sizeof(ODDescType));
- return desc;
- }
-
- //---------------------------------------------------------------------------------------
- // operator FW_CDesc& >> ODDescType&
- //---------------------------------------------------------------------------------------
-
- const FW_CDesc& operator>> (const FW_CDesc& desc, ODDescType& typeValue)
- {
- Size actualSize;
-
- desc.GetDataByPtr(typeType, &typeValue, actualSize, sizeof(ODDescType));
- return desc;
- }
-
- //---------------------------------------------------------------------------------------
- // operator FW_CDesc& << long&
- //---------------------------------------------------------------------------------------
-
- FW_CDesc& operator<< (FW_CDesc& desc, long value)
- {
- desc.PutDataByPtr(typeLongInteger, &value, sizeof(long));
- return desc;
- }
-
- //---------------------------------------------------------------------------------------
- // operator FW_CDesc& >> long&
- //---------------------------------------------------------------------------------------
-
- const FW_CDesc& operator>> (const FW_CDesc& desc, long& value)
- {
- Size actualSize;
-
- desc.GetDataByPtr(typeLongInteger, &value, actualSize, sizeof(long));
- return desc;
- }
-
- //---------------------------------------------------------------------------------------
- // operator FW_CDesc& << FW_CColor&
- //---------------------------------------------------------------------------------------
-
- FW_CDesc& operator<< (FW_CDesc& desc, const FW_CColor& color)
- {
- desc.PutColor(color);
- return desc;
- }
-
- //---------------------------------------------------------------------------------------
- // operator FW_CDesc& >> FW_CColor&
- //---------------------------------------------------------------------------------------
-
- const FW_CDesc& operator>> (const FW_CDesc& desc, FW_CColor& color)
- {
- desc.GetColor(color);
- return desc;
- }
-
- //---------------------------------------------------------------------------------------
- // operator FW_CDesc& << FW_SPlatformPoint&
- //---------------------------------------------------------------------------------------
-
- FW_CDesc& operator<< (FW_CDesc& desc, const FW_SPlatformPoint& thePoint)
- {
- desc.PutPoint(thePoint);
- return desc;
- }
-
- //---------------------------------------------------------------------------------------
- // operator FW_CDesc& >> FW_SPlatformPoint&
- //---------------------------------------------------------------------------------------
-
- const FW_CDesc& operator>> (const FW_CDesc& desc, FW_SPlatformPoint& thePoint)
- {
- thePoint = desc.GetPoint();
- return desc;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_InsertScriptableIntoDesc
- //----------------------------------------------------------------------------------------
-
- void FW_InsertScriptableIntoDesc(const FW_MScriptable* scriptable, FW_CDesc& desc)
- {
- desc.PutDataByPtr(scriptable->GetTokenType(), &scriptable, sizeof(scriptable));
- }
-
- //----------------------------------------------------------------------------------------
- // FW_ExtractScriptableFromDesc
- //----------------------------------------------------------------------------------------
-
- FW_MScriptable* FW_ExtractScriptableFromDesc(const FW_CDesc& desc)
- {
- Size actualSize;
- FW_MScriptable* scriptable;
-
- desc.GetDataByPtr(typeODFSemanticObject, &scriptable, actualSize, sizeof(scriptable));
- return scriptable;
- }
-